#include "../skyAdapter.h"

#ifdef _SYMBIAN
#include <e32std.h>
#include <e32base.h>
#include <f32file.h>
#include <eikenv.h>
#include <hal_data.h>
#include <CHARCONV.H>
#include <gdi.h>
#include "../skyFont.h"
namespace Sky
{
	TBool FontManager::createFont(String* fontName,TInt weight,TInt height,TInt width,Font* font)
	{
		//TFontSpec itemFontSpec(TPtrC((TUint16*)fontName->toCharString()), weight );
		
		TPtrC8 ptr((unsigned char*)fontName->toCharString()); 
		HBufC *buf = HBufC::NewL(fontName->getLength() + 2); 
		buf->Des().Copy(ptr);
		AutoPtr<HBufC> aPtr(buf);
			
		TFontSpec itemFontSpec(TPtrC(fontName->toCharString()), weight );	
		CGraphicsDevice* screenDevice = CEikonEnv::Static()->ScreenDevice();
		screenDevice->GetNearestFontInTwips(font->_font,itemFontSpec);
		return vTrue;
	}

	OSFont::~OSFont()
	{
		if ( _font )
		{
			CGraphicsDevice* screenDevice = CEikonEnv::Static()->ScreenDevice();
			screenDevice->ReleaseFont(_font);
		}
	}

}
#endif //_SYMBIAN

